const { DataTypes } = require('sequelize');
const sequelize = require('../config/database');

const Bottle = sequelize.define('Bottle', {
    id: {
        type: DataTypes.INTEGER,
        primaryKey: true,
        autoIncrement: true
    },
    message: {
        type: DataTypes.TEXT,
        allowNull: false
    },
    email: {
        type: DataTypes.STRING,
        allowNull: true
    },
    status: {
        type: DataTypes.ENUM('active', 'picked', 'deleted'),
        defaultValue: 'active'
    },
    pickTime: {
        type: DataTypes.DATE,
        allowNull: true
    },
    pickerEmail: {
        type: DataTypes.STRING,
        allowNull: true
    }
}, {
    timestamps: true,
    indexes: [
        {
            fields: ['status']
        }
    ]
});

module.exports = Bottle; 